#ifndef TG_DOCUMENTVIEW_H
#define TG_DOCUMENTVIEW_H

#include <QGraphicsView>

class TgDocumentView : public QGraphicsView
{
    Q_OBJECT
    typedef QGraphicsView BaseClass;

public:
    explicit TgDocumentView(QWidget *parent = 0);  

    inline int zoom() const;
    inline qreal zoomReal() const;
    void setZoom(int zoom);

public slots:
    void zoomIn();
    void zoomOut();

signals:
    void zoomChanged();

protected:
    virtual void wheelEvent(QWheelEvent * event);

    int m_zoom;
};

//////////////////////////////////////////////////////

int TgDocumentView::zoom() const
{
    return m_zoom;
}

qreal TgDocumentView::zoomReal() const
{
    return (qreal) m_zoom / 100.;
}

#endif // TG_DOCUMENTVIEW_H
